#ifndef _InputFileReader_Digi_
#define _InputFileReader_Digi_

#include "TChain.h"
#include "TVector3.h"
#include "yaml.h"
#include <vector>

#define MAXOPPHOTON 2000

struct aSimPhoton
{
    Double_t Energy;
    Double_t CatchTime;
    TVector3 Pos;
    TVector3 MomDir;
};

struct aSimEvent
{
    Int_t Type;
    Double_t Energy;
    TVector3 Pos;
    TVector3 MomDir;
    std::vector<aSimPhoton> VSimPhoton;
};

class InputFileReader
{
public:
    InputFileReader(YAML::Node);
    ~InputFileReader();

    aSimEvent aEvent();

private:
    TChain* m_Chain;
    Long64_t m_iEntry;
    Long64_t m_NumOfEntry;

    //Input Tree
    Int_t    m_PGTypeFlag;
    Double_t m_TruthEnergy;
    Double_t m_TruthPos[3];
    Double_t m_TruthMomDir[3];
    Int_t    m_NumOfOpPhoton;
    Double_t m_PhotonEnergy[MAXOPPHOTON];
    Double_t m_PhotonCatchTime[MAXOPPHOTON];
    Double_t m_PhotonPos[MAXOPPHOTON][3];
    Double_t m_PhotonMomDir[MAXOPPHOTON][3];


};

#endif